package com.bawei.yangzongcai___chenmei.BlankFragment.BannerLunboImg;


import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.bawei.yangzongcai___chenmei.JavaClass.JavaLianxi;
import com.bawei.yangzongcai___chenmei.MVC.BsaeFragment;
import com.bawei.yangzongcai___chenmei.R;
import com.blankj.utilcode.util.ToastUtils;
import com.bumptech.glide.Glide;
import com.youth.banner.Banner;
import com.youth.banner.BannerConfig;
import com.youth.banner.Transformer;
import com.youth.banner.loader.ImageLoader;

import java.util.ArrayList;
import java.util.List;


public class BannerLunBoImag002 extends BsaeFragment {

    private List<Integer> img_list = new ArrayList<>();
    private Banner lunbo002Banner;
    private ImageView lunbo002Handing;

    @Override
    public int bandLayout() {
        return R.layout.fragment_blank_banner_img2;
    }

    @Override
    public void initView() {

        lunbo002Banner = findbandid(R.id.lunbo002_banner);
        lunbo002Handing = findbandid(R.id.lunbo002_handing);
    }

    @Override
    public void initDate() {

        lunbo002Handing.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ToastUtils.showShort("推动行业进步 建设健康环保、时尚快乐的休闲生活！！");
            }
        });

        img_list.add(R.drawable.handing9);
        img_list.add(R.drawable.handing5);
        img_list.add(R.drawable.handing6);
        img_list.add(R.drawable.handing7);
        img_list.add(R.drawable.handing8);
        img_list.add(R.drawable.handing9);

        lunbo002Banner.setBannerAnimation(Transformer.CubeOut);
        lunbo002Banner.setIndicatorGravity(BannerConfig.CENTER);
        lunbo002Banner.setImages(img_list);
        lunbo002Banner.setBannerStyle(BannerConfig.CIRCLE_INDICATOR);
        lunbo002Banner.setImageLoader(new ImageLoader() {
            @Override
            public void displayImage(Context context, Object path, ImageView imageView) {
                imageView.setImageResource((Integer) path);
            }
        }).start();

    }
}
